%
% Status : main Dynare file 
%
% Warning : this file is generated automatically by Dynare
%           from model file (.mod)

clear all
tic;
global M_ oo_ options_ ys0_ ex0_ estimation_info
options_ = [];
M_.fname = 'a15_markups';
%
% Some global variables initialization
%
global_initialization;
diary off;
diary('a15_markups.log');
M_.exo_names = 'e';
M_.exo_names_tex = 'e';
M_.exo_names_long = 'e';
M_.exo_names = char(M_.exo_names, 'u');
M_.exo_names_tex = char(M_.exo_names_tex, 'u');
M_.exo_names_long = char(M_.exo_names_long, 'u');
M_.endo_names = 'rho';
M_.endo_names_tex = 'rho';
M_.endo_names_long = 'rho';
M_.endo_names = char(M_.endo_names, 'Drhot');
M_.endo_names_tex = char(M_.endo_names_tex, 'Drhot');
M_.endo_names_long = char(M_.endo_names_long, 'Drhot');
M_.endo_names = char(M_.endo_names, 'Gamma');
M_.endo_names_tex = char(M_.endo_names_tex, 'Gamma');
M_.endo_names_long = char(M_.endo_names_long, 'Gamma');
M_.endo_names = char(M_.endo_names, 'y');
M_.endo_names_tex = char(M_.endo_names_tex, 'y');
M_.endo_names_long = char(M_.endo_names_long, 'y');
M_.endo_names = char(M_.endo_names, 'c');
M_.endo_names_tex = char(M_.endo_names_tex, 'c');
M_.endo_names_long = char(M_.endo_names_long, 'c');
M_.endo_names = char(M_.endo_names, 'k');
M_.endo_names_tex = char(M_.endo_names_tex, 'k');
M_.endo_names_long = char(M_.endo_names_long, 'k');
M_.endo_names = char(M_.endo_names, 'x');
M_.endo_names_tex = char(M_.endo_names_tex, 'x');
M_.endo_names_long = char(M_.endo_names_long, 'x');
M_.endo_names = char(M_.endo_names, 'l');
M_.endo_names_tex = char(M_.endo_names_tex, 'l');
M_.endo_names_long = char(M_.endo_names_long, 'l');
M_.endo_names = char(M_.endo_names, 'lambda');
M_.endo_names_tex = char(M_.endo_names_tex, 'lambda');
M_.endo_names_long = char(M_.endo_names_long, 'lambda');
M_.endo_names = char(M_.endo_names, 'nu');
M_.endo_names_tex = char(M_.endo_names_tex, 'nu');
M_.endo_names_long = char(M_.endo_names_long, 'nu');
M_.endo_names = char(M_.endo_names, 'r');
M_.endo_names_tex = char(M_.endo_names_tex, 'r');
M_.endo_names_long = char(M_.endo_names_long, 'r');
M_.endo_names = char(M_.endo_names, 'w');
M_.endo_names_tex = char(M_.endo_names_tex, 'w');
M_.endo_names_long = char(M_.endo_names_long, 'w');
M_.endo_names = char(M_.endo_names, 'mu');
M_.endo_names_tex = char(M_.endo_names_tex, 'mu');
M_.endo_names_long = char(M_.endo_names_long, 'mu');
M_.endo_names = char(M_.endo_names, 'q');
M_.endo_names_tex = char(M_.endo_names_tex, 'q');
M_.endo_names_long = char(M_.endo_names_long, 'q');
M_.endo_names = char(M_.endo_names, 'S');
M_.endo_names_tex = char(M_.endo_names_tex, 'S');
M_.endo_names_long = char(M_.endo_names_long, 'S');
M_.endo_names = char(M_.endo_names, 'Sp');
M_.endo_names_tex = char(M_.endo_names_tex, 'Sp');
M_.endo_names_long = char(M_.endo_names_long, 'Sp');
M_.endo_names = char(M_.endo_names, 'g');
M_.endo_names_tex = char(M_.endo_names_tex, 'g');
M_.endo_names_long = char(M_.endo_names_long, 'g');
M_.endo_names = char(M_.endo_names, 'dy');
M_.endo_names_tex = char(M_.endo_names_tex, 'dy');
M_.endo_names_long = char(M_.endo_names_long, 'dy');
M_.endo_names = char(M_.endo_names, 'z_a');
M_.endo_names_tex = char(M_.endo_names_tex, 'z\_a');
M_.endo_names_long = char(M_.endo_names_long, 'z_a');
M_.endo_names = char(M_.endo_names, 'z_g');
M_.endo_names_tex = char(M_.endo_names_tex, 'z\_g');
M_.endo_names_long = char(M_.endo_names_long, 'z_g');
M_.endo_names = char(M_.endo_names, 'AUX_ENDO_LAG_19_1');
M_.endo_names_tex = char(M_.endo_names_tex, 'AUX\_ENDO\_LAG\_19\_1');
M_.endo_names_long = char(M_.endo_names_long, 'AUX_ENDO_LAG_19_1');
M_.param_names = 'beta';
M_.param_names_tex = 'beta';
M_.param_names_long = 'beta';
M_.param_names = char(M_.param_names, 'psi');
M_.param_names_tex = char(M_.param_names_tex, 'psi');
M_.param_names_long = char(M_.param_names_long, 'psi');
M_.param_names = char(M_.param_names, 'delta');
M_.param_names_tex = char(M_.param_names_tex, 'delta');
M_.param_names_long = char(M_.param_names_long, 'delta');
M_.param_names = char(M_.param_names, 'alpha');
M_.param_names_tex = char(M_.param_names_tex, 'alpha');
M_.param_names_long = char(M_.param_names_long, 'alpha');
M_.param_names = char(M_.param_names, 'gamma');
M_.param_names_tex = char(M_.param_names_tex, 'gamma');
M_.param_names_long = char(M_.param_names_long, 'gamma');
M_.param_names = char(M_.param_names, 'gss');
M_.param_names_tex = char(M_.param_names_tex, 'gss');
M_.param_names_long = char(M_.param_names_long, 'gss');
M_.param_names = char(M_.param_names, 'sigma');
M_.param_names_tex = char(M_.param_names_tex, 'sigma');
M_.param_names_long = char(M_.param_names_long, 'sigma');
M_.param_names = char(M_.param_names, 'theta');
M_.param_names_tex = char(M_.param_names_tex, 'theta');
M_.param_names_long = char(M_.param_names_long, 'theta');
M_.param_names = char(M_.param_names, 'phi');
M_.param_names_tex = char(M_.param_names_tex, 'phi');
M_.param_names_long = char(M_.param_names_long, 'phi');
M_.param_names = char(M_.param_names, 'N');
M_.param_names_tex = char(M_.param_names_tex, 'N');
M_.param_names_long = char(M_.param_names_long, 'N');
M_.param_names = char(M_.param_names, 'eta');
M_.param_names_tex = char(M_.param_names_tex, 'eta');
M_.param_names_long = char(M_.param_names_long, 'eta');
M_.param_names = char(M_.param_names, 'muc');
M_.param_names_tex = char(M_.param_names_tex, 'muc');
M_.param_names_long = char(M_.param_names_long, 'muc');
M_.param_names = char(M_.param_names, 'a');
M_.param_names_tex = char(M_.param_names_tex, 'a');
M_.param_names_long = char(M_.param_names_long, 'a');
M_.param_names = char(M_.param_names, 'b');
M_.param_names_tex = char(M_.param_names_tex, 'b');
M_.param_names_long = char(M_.param_names_long, 'b');
M_.param_names = char(M_.param_names, 'rho_a');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_a');
M_.param_names_long = char(M_.param_names_long, 'rho_a');
M_.param_names = char(M_.param_names, 'rho_g_1');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_g\_1');
M_.param_names_long = char(M_.param_names_long, 'rho_g_1');
M_.param_names = char(M_.param_names, 'rho_g_2');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_g\_2');
M_.param_names_long = char(M_.param_names_long, 'rho_g_2');
M_.param_names = char(M_.param_names, 'var_e');
M_.param_names_tex = char(M_.param_names_tex, 'var\_e');
M_.param_names_long = char(M_.param_names_long, 'var_e');
M_.param_names = char(M_.param_names, 'var_u');
M_.param_names_tex = char(M_.param_names_tex, 'var\_u');
M_.param_names_long = char(M_.param_names_long, 'var_u');
M_.exo_det_nbr = 0;
M_.exo_nbr = 2;
M_.endo_nbr = 21;
M_.param_nbr = 19;
M_.orig_endo_nbr = 20;
M_.aux_vars(1).endo_index = 21;
M_.aux_vars(1).type = 1;
M_.aux_vars(1).orig_index = 20;
M_.aux_vars(1).orig_lead_lag = -1;
M_.Sigma_e = zeros(2, 2);
M_.Correlation_matrix = eye(2, 2);
M_.H = 0;
M_.Correlation_matrix_ME = 1;
M_.sigma_e_is_diagonal = 1;
options_.block=0;
options_.bytecode=0;
options_.use_dll=0;
erase_compiled_function('a15_markups_static');
erase_compiled_function('a15_markups_dynamic');
M_.lead_lag_incidence = [
 0 7 0;
 0 8 0;
 0 9 28;
 0 10 29;
 1 11 30;
 2 12 0;
 3 13 31;
 0 14 0;
 0 15 32;
 0 16 33;
 0 17 34;
 0 18 0;
 0 19 0;
 0 20 0;
 0 21 0;
 0 22 35;
 0 23 0;
 0 24 0;
 4 25 0;
 5 26 0;
 6 27 0;]';
M_.nstatic = 9;
M_.nfwrd   = 6;
M_.npred   = 4;
M_.nboth   = 2;
M_.nsfwrd   = 8;
M_.nspred   = 6;
M_.ndynamic   = 12;
M_.equations_tags = {
};
M_.static_and_dynamic_models_differ = 0;
M_.exo_names_orig_ord = [1:2];
M_.maximum_lag = 1;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 1;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(21, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(2, 1);
M_.params = NaN(19, 1);
M_.NNZDerivatives = zeros(3, 1);
M_.NNZDerivatives(1) = 78;
M_.NNZDerivatives(2) = -1;
M_.NNZDerivatives(3) = -1;
load parameterfile;
set_param_value('a',a_p);               
set_param_value('b',b_p);               
set_param_value('rho_g_1',rho_g_1_p);   
set_param_value('rho_g_2',rho_g_2_p);   
set_param_value('gamma',gamma_p);       
set_param_value('N',N_p);               
set_param_value('var_e',var_e_p);       
set_param_value('var_u',var_u_p);       
set_param_value('phi',phi_p);           
M_.params( 8 ) = 2;
theta = M_.params( 8 );
M_.params( 4 ) = 0.35;
alpha = M_.params( 4 );
M_.params( 1 ) = 0.993;
beta = M_.params( 1 );
M_.params( 3 ) = 0.025;
delta = M_.params( 3 );
M_.params( 2 ) = 0.4;
psi = M_.params( 2 );
M_.params( 15 ) = 0.95;
rho_a = M_.params( 15 );
M_.params( 7 ) = 4;
sigma = M_.params( 7 );
M_.params( 11 ) = 20;
eta = M_.params( 11 );
M_.params( 6 ) = (-1.6);
gss = M_.params( 6 );
M_.params( 12 ) = (M_.params(11)*(M_.params(10)-1)+M_.params(7))/(M_.params(11)*(M_.params(10)-1)+M_.params(7)-M_.params(10));
muc = M_.params( 12 );
%
% INITVAL instructions
%
options_.initval_file = 0;
oo_.steady_state( 4 ) = 0.009950330853168092;
oo_.steady_state( 5 ) = (-0.5798184952529421);
oo_.steady_state( 6 ) = 2.128231705849268;
oo_.steady_state( 7 ) = (-1.6094379124341);
oo_.steady_state( 8 ) = (-1.108662624521611);
oo_.steady_state( 15 ) = 0;
oo_.steady_state( 16 ) = 0;
oo_.steady_state( 13 ) = 0.3;
oo_.steady_state( 14 ) = 0;
oo_.steady_state( 4 ) = 0;
oo_.steady_state( 1 ) = (-.15);
oo_.steady_state( 2 ) = 0.06;
oo_.steady_state( 3 ) = (-2.78);
oo_.steady_state( 11 ) = (-3.506557897319982);
oo_.steady_state( 12 ) = 0.4885800148186709;
oo_.steady_state( 14 ) = log(M_.params(1));
oo_.steady_state( 19 ) = 0;
oo_.steady_state( 20 ) = 0;
oo_.steady_state(21)=oo_.steady_state(20);
if M_.exo_nbr > 0;
	oo_.exo_simul = [ones(M_.maximum_lag,1)*oo_.exo_steady_state'];
end;
if M_.exo_det_nbr > 0;
	oo_.exo_det_simul = [ones(M_.maximum_lag,1)*oo_.exo_det_steady_state'];
end;
%
% SHOCKS instructions
%
make_ex_;
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = M_.params(18);
M_.Sigma_e(2, 2) = M_.params(19);
steady;
oo_.dr.eigval = check(M_,options_,oo_);
options_.drop = 1000;
options_.irf = 20;
options_.nograph = 1;
options_.noprint = 1;
options_.order = 1;
options_.periods = 10000;
var_list_=[];
info = stoch_simul(var_list_);
save('a15_markups_results.mat', 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save('a15_markups_results.mat', 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save('a15_markups_results.mat', 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save('a15_markups_results.mat', 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save('a15_markups_results.mat', 'estimation_info', '-append');
end


disp(['Total computing time : ' dynsec2hms(toc) ]);
if ~isempty(lastwarn)
  disp('Note: warning(s) encountered in MATLAB/Octave code')
end
diary off
